<template>
  <div>
    <el-button
      ref="fieldEditor"
      :type="field.options.buttonType"
      :size="field.options.size"
      :plain="field.options.plain"
      :round="field.options.round"
      :circle="field.options.circle"
      :icon="field.options.icon"
      :disabled="field.options.disabled"
      @click.native="handleButtonClick"
    >
      {{ field.options.buttonLabel }}
    </el-button>
  </div>
</template>

<script>
/* eslint-disable vue/require-default-prop */
/* eslint-disable eol-last */
import tableMixin from "./tableMixin";

export default {
  name: "table_button_unit",
  componentName: "FieldWidget",
  mixins: [tableMixin],
  props: {
    designer: Object,
    field: Object,
    formRow: Object,
    formData: Object,
    designState: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      oldFieldValue: null,
      fieldModel: null,
      rules: [],
    };
  },
  beforeCreate() {
    /* 这里不能访问方法和属性！！ */
  },
  created() {
    /* 注意：子组件mounted在父组件created之后、父组件mounted之前触发，故子组件mounted需要用到的prop
         需要在父组件created中初始化！！ */
    // this.initFieldModel();
    // this.registerToRefList();
    // this.buildFieldRules();
    this.handleOnCreated();
  },
  mounted() {
    this.initEventHandler();
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
@import "../../../../../../styles/global.scss"; //* form-item-wrapper已引入，还需要重复引入吗？ *//

::v-deep {
  .el-input__inner {
    padding: 0 8px;
  }
}
</style>
